package com.xinyue.design.simpleFactory.wayTwo;

public class PersonFactory{

	//私有化工厂类的构造方法，使用静态方法来创建接口实现类。
	private PersonFactory() {
		
	}
	
	public static Person createPerson(String classType) {
		Person person = null;
		
		try {
			person = (Person)Class.forName(classType).newInstance();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return person;
	}
}
